package cc.yugu.yhdw.common.domain.hdw;

import cc.yugu.yhdw.common.annotation.Transient;
import cc.yugu.yhdw.common.domain.Distance;
import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 柜子
 */
public class Cabinet extends CabinetInfo implements Distance {

    public enum LogType {
        DEBUG(1, "DEBUG"),
        INFO(2, "INFO"),
        WARN(3, "WARN"),
        ERROR(4, "ERROR");
        private final int value;
        private final String name;

        private LogType(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();

        static {
            for (LogType e : LogType.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    Integer status;
    String ip;
    String mac;
    String version;
    Integer normalFlag;
    Integer onlineFlag;
    Date heartTime;
    String openTime;
    Date createTime;
    String statusInfo;
    Integer dividePlanId;
    Integer fullVolume;
    Integer chargeNum;
    byte mainBoardNo;
    byte fst;
    byte fot;
    byte pt;
    byte rpt;
    byte temperature;
    byte chargingMode;
    Long priceSettingId;     /*价格设置id*/

    @Transient
    int freePoint;
    int price;
    @Transient
    double distance;
    @Transient
    String agencyName, agentName, strategyName, cabinetSupplierName, powerSupplierName, dividePlanName,priceSettingName;

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public Long getPriceSettingId() {
        return priceSettingId;
    }

    public void setPriceSettingId(Long priceSettingId) {
        this.priceSettingId = priceSettingId;
    }

    public String getPriceSettingName() {
        return priceSettingName;
    }

    public void setPriceSettingName(String priceSettingName) {
        this.priceSettingName = priceSettingName;
    }

    public Integer getFullVolume() {
        return fullVolume;
    }

    public void setFullVolume(Integer fullVolume) {
        this.fullVolume = fullVolume;
    }

    public Integer getChargeNum() {
        return chargeNum;
    }

    public void setChargeNum(Integer chargeNum) {
        this.chargeNum = chargeNum;
    }

    public byte getChargingMode() {
        return chargingMode;
    }

    public byte getMainBoardNo() {
        return mainBoardNo;
    }

    public void setMainBoardNo(byte mainBoardNo) {
        this.mainBoardNo = mainBoardNo;
    }

    public void setChargingMode(byte chargingMode) {
        this.chargingMode = chargingMode;
    }

    public byte getTemperature() {
        return temperature;
    }

    public void setTemperature(byte temperature) {
        this.temperature = temperature;
    }

    public byte getFst() {
        return fst;
    }

    public void setFst(byte fst) {
        this.fst = fst;
    }

    public byte getFot() {
        return fot;
    }

    public void setFot(byte fot) {
        this.fot = fot;
    }

    public byte getPt() {
        return pt;
    }

    public void setPt(byte pt) {
        this.pt = pt;
    }

    public byte getRpt() {
        return rpt;
    }

    public void setRpt(byte rpt) {
        this.rpt = rpt;
    }

    public String getPowerSupplierName() {
        return powerSupplierName;
    }

    public void setPowerSupplierName(String powerSupplierName) {
        this.powerSupplierName = powerSupplierName;
    }

    public String getDividePlanName() {
        return dividePlanName;
    }

    public void setDividePlanName(String dividePlanName) {
        this.dividePlanName = dividePlanName;
    }

    public String getCabinetSupplierName() {
        return cabinetSupplierName;
    }

    public void setCabinetSupplierName(String cabinetSupplierName) {
        this.cabinetSupplierName = cabinetSupplierName;
    }

    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public Integer getDividePlanId() {
        return dividePlanId;
    }

    public void setDividePlanId(Integer dividePlanId) {
        this.dividePlanId = dividePlanId;
    }

    public String getStatusInfo() {
        return statusInfo;
    }

    public void setStatusInfo(String statusInfo) {
        this.statusInfo = statusInfo;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Integer getNormalFlag() {
        return normalFlag;
    }

    public void setNormalFlag(Integer normalFlag) {
        this.normalFlag = normalFlag;
    }

    public Integer getOnlineFlag() {
        return onlineFlag;
    }

    public void setOnlineFlag(Integer onlineFlag) {
        this.onlineFlag = onlineFlag;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getHeartTime() {
        return heartTime;
    }

    public void setHeartTime(Date heartTime) {
        this.heartTime = heartTime;
    }

    public String getOpenTime() {
        return openTime;
    }

    public void setOpenTime(String openTime) {
        this.openTime = openTime;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getStrategyName() {
        return strategyName;
    }

    public void setStrategyName(String strategyName) {
        this.strategyName = strategyName;
    }

    public String getAgencyName() {
        return agencyName;
    }

    public void setAgencyName(String agencyName) {
        this.agencyName = agencyName;
    }

    public int getFreePoint() {
        return freePoint;
    }

    public void setFreePoint(int freePoint) {
        this.freePoint = freePoint;
    }

    @Override
    public double getDistance() {
        return distance;
    }

    @Override
    public void setDistance(double distance) {
        this.distance = distance;
    }
}
